home *** CD-ROM | disk | FTP | other *** search
- Name
-
- SGIS_point_parameters
-
- Name Strings
-
- GL_SGIS_point_parameters
-
- Version
-
- $Date: 1996/04/01 23:23:08 $ $Revision: 1.1 $
-
- Number
-
- 54
-
- Dependencies
-
- SGIS_multisample
-
- Overview
-
- This extension supports additional geometric characteristics of points. It
- can be used to render tiny light sources, commonly referred as "Light
- points".
-
- The raster brightness of a point is a function of the point area, point
- color, point transparency, and the response of the display's electron gun
- and phosphor. The point area and the point transparency are derived from the
- point size, currently provided with the <size> parameter of glPointSize.
-
- The primary motivation is to allow the size of a point to be affected by
- distance attenuation. When distance attenuation has an effect, the final
- point size decreases as the distance of the point from the eye increases.
-
- The secondary motivation is a mean to control the mapping from the point
- size to the raster point area and point transparency. This is done in order
- to increase the dynamic range of the raster brightness of points. In other
- words, the alpha component of a point may be decreased (and its transparency
- increased) as its area shrinks below a defined threshold.
-
- This extension defines a derived point size to be closely related to point
- brightness. The brightness of a point is given by:
-
- 1
- dist_atten(d) = -------------------
- a + b * d + c * d^2
-
- brightness(Pe) = Brightness * dist_atten(|Pe|)
-
- where 'Pe' is the point in eye coordinates, and 'Brightness' is some initial
- value proportional to the square of the size provided with glPointSize. Here
- we simplify the raster brightness to be a function of the rasterized point
- area and point transparency.
-
- brightness(Pe) brightness(Pe) >= Threshold_Area
- area(Pe) =
- Threshold_Area Otherwise
-
- factor(Pe) = brightness(Pe)/Threshold_Area
-
- alpha(Pe) = Alpha * factor(Pe)
-
- where 'Alpha' comes with the point color (possibly modified by lighting).
-
- 'Threshold_Area' above is in area units. Thus, it is proportional to the
- square of the threshold provided by the programmer through this extension.
-
- The new point size derivation method applies to all points, while the
- threshold applies to multisample points only.
-
- Issues
-
- * Does point alpha modification affect the current color ?
-
- No.
-
- * Do we need a special function glGetPointParameterfvSGIS, or get by with
- glGetFloat ?
-
- No.
-
- * If alpha is 0, then we could toss the point before it reaches the
- fragment stage.
-
- No. This can be achieved with enabling the alpha test with reference of
- 0 and function of LEQUAL.
-
- * Do we need a disable for applying the threshold ? The default threshold
- value is 1.0. It is applied even if the point size is constant.
-
- If the default threshold is not overriden, the area of multisample
- points with provided constant size of less than 1.0, is mapped to 1.0,
- while the alpha component is modulated accordingly, to compensate for
- the larger area. For multisample points this is not a problem, as there
- are no relevant applications yet. As mentioned above, the threshold does
- not apply to alias or antialias points.
-
- The alternative is to have a disable of threshold application, and state
- that threshold (if not disabled) applies to non antialias points only
- (that is, alias and multisample points).
-
- The behavior without an enable/disable looks fine.
-
- * Future extensions (to the extension)
-
- 1. GL_POINT_FADE_ALPHA_CLAMP_SGIS
-
- When the derived point size is larger than the threshold size defined by
- the GL_POINT_FADE_THRESHOLD_SIZE_SGIS parameter, it might be desired to
- clamp the computed alpha to a minimum value, in order to keep the point
- visible. In this case the formula below change:
-
- factor = (derived_size/threshold)^2
-
- factor clamp <= factor
- clamped_value =
- clamp factor < clamp
-
- 1.0 derived_size >= threshold
- alpha *=
- clamped_value Otherwise
-
- where clamp is defined by the GL_POINT_FADE_ALPHA_CLAMP_SGIS new parameter.
-
- New Procedures and Functions
-
- void glPointParameterfSGIS ( GLenum pname, GLfloat param );
- void glPointParameterfvSGIS ( GLenum pname, GLfloat *params );
-
- New Tokens
-
- Accepted by the <pname> parameter of glPointParameterfSGIS, and the <pname>
- of glGet:
-
- GL_POINT_SIZE_MIN_SGIS
- GL_POINT_SIZE_MAX_SGIS
- GL_POINT_FADE_THRESHOLD_SIZE_SGIS
-
- Accepted by the <pname> parameter of glPointParameterfvSGIS, and the <pname>
- of glGet:
-
- GL_POINT_SIZE_MIN_SGIS
- GL_POINT_SIZE_MAX_SGIS
- GL_POINT_FADE_THRESHOLD_SIZE_SGIS
- GL_DISTANCE_ATTENUATION_SGIS
-
- Additions to Chapter 2 of the 1.0 Specification (OpenGL Operation)
-
- None
-
- Additions to Chapter 3 of the 1.0 Specification (Rasterization)
-
- All parameters of the glPointParameterfSGIS and glPointParameterfvSGIS
- functions set various values applied to point rendering. The derived point
- size is defined to be the <size> provided with glPointSize modulated with a
- distance attenuation factor.
-
- The parameters GL_POINT_SIZE_MIN_SGIS and GL_POINT_SIZE_MAX_SGIS simply
- define an upper and lower bounds respectively on the derived point size.
-
- The above parameters affect non multisample points as well as multisample
- points, while the GL_POINT_FADE_THRESHOLD_SIZE_SGIS parameter, has no effect
- on non multisample points. If the derived point size is larger than
- the threshold size defined by the GL_POINT_FADE_THRESHOLD_SIZE_SGIS
- parameter, the derived point size is used as the diameter of the rasterized
- point, and the alpha component is intact. Otherwise, the threshold size is
- set to be the diameter of the rasterized point, while the alpha component is
- modulated accordingly, to compensate for the larger area.
-
- The distance attenuation function coefficients, namely a, b, and c in:
-
- 1
- dist_atten(d) = -------------------
- a + b * d + c * d^2
-
- are defined by the <pname> parameter GL_DISTANCE_ATTENUATION_SGIS of the
- function glPointParameterfvSGIS. By default a = 1, b = 0, and c = 0.
-
- Let 'size' be the point size provided with glPointSize, let 'dist' be the
- distance of the point from the eye, and let 'threshold' be the threshold size
- defined by the GL_POINT_FADE_THRESHOLD_SIZE parameter of
- glPointParameterfSGIS. The derived point size is given by:
-
- derived_size = size * sqrt(dist_atten(dist))
-
- Note that when default values are used, the above formula reduces to:
-
- derived_size = size
-
- the diameter of the rasterized point is given by:
-
- derived_size derived_size >= threshold
- diameter =
- threshold Otherwise
-
- The alpha of a point is calculated to allow the fading of points instead of
- shrinking them past a defined threshold size. The alpha component of the
- rasterized point is given by:
-
- 1 derived_size >= threshold
- alpha *=
- (derived_size/threshold)^2 Otherwise
-
- The threshold defined by GL_POINT_FADE_THRESHOLD_SIZE_SGIS is not clamped
- to the minimum and maximum point sizes.
-
- Points do not affect the current color.
-
- This extension doesn't change the feedback or selection behavior of points.
-
- Additions to Chapter 4 of the 1.0 Specification (Per-Fragment Operations
- and the Framebuffer)
-
- None
-
- Additions to Chapter 5 of the 1.0 Specification (Special Functions)
-
- None
-
- Additions to Chapter 6 of the 1.0 Specification (State and State Requests)
-
- None
-
- Additions to the GLX Specification
-
- None
-
- Errors
-
- INVALID_ENUM is generated if PointParameterfSGIS parameter <pname> is not
- GL_POINT_SIZE_MIN_SGIS, GL_POINT_SIZE_MAX_SIZE_SGIS, or
- GL_POINT_FADE_THRESHOLD_SIZE_SGIS.
-
- INVALID_ENUM is generated if PointParameterfvSGIS parameter <pname> is not
- GL_DISTANCE_ATTENUATION_SGIS
-
- INVALID_VALUE is generated when values are out of range according to:
-
- <pname> valid range
- -------- -----------
- GL_POINT_SIZE_MIN_SGIS >= 0
- GL_POINT_SIZE_MAX_SGIS >= 0
- GL_POINT_FADE_THRESHOLD_SIZE_SGIS >= 0
-
- Issues
- ------
- - should we generate INVALID_VALUE or just clamp?
-
- New State
-
- Get Value Get Command Type Initial Value Attribute
- --------- ----------- ---- --------- ---------
- GL_POINT_SIZE_MIN_SGIS GetFloatv R 0 point
- GL_POINT_SIZE_MAX_SGIS GetFloatv R M point
- GL_POINT_FADE_THRESHOLD_SIZE_SGIS GetFloatv R 1 point
- GL_DISTANCE_ATTENUATION_SGIS GetFloatv 3xR (1,0,0) point
-
- M is the largest available point size.
-
- New Implementation Dependent State
-
- None
-